home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / utilsys / recorder.lha / Recorder.doc < prev   
Text File  |  1996-05-08  |  16KB  |  375 lines

  1.  
  2.  
  3.                   Recorder V1.3
  4.                   -------------
  5.  
  6.                   Released May, 8th 1996
  7.  
  8.  
  9.            Written and Copyright ©1991/1996 by Oliver Grimm
  10.  
  11.  
  12.  
  13.  
  14.   1. COPYRIGHT
  15.   ============
  16.  
  17.   Both the program 'Recorder' and this documentation are copyrighted
  18.   by me, but they are public domain software. That means you can use
  19.   and spread them legally without paying any contributions (But I wouldn't
  20.   reject them, too ..) as long as everything remains unmodified, only
  21.   the complete archive, program plus documention, is distributed, and 
  22.   if you don't use the program commercially without my explicit permission
  23.   (Please contact me in that case. My address can be found at the end of
  24.   this text.)
  25.     
  26.  
  27.  
  28.   2. DISCLAIMER
  29.   =============
  30.  
  31.   As usual, no warranty for anything ...
  32.  
  33.  
  34.  
  35.   3. INTRODUCTION
  36.   ===============
  37.  
  38.   Whenever you hit a key, move the mouse, insert or remove a disk,
  39.   resize a window, or basically make any kind of input to your computer,
  40.   the operating system creates something that is called an 'input event'.
  41.   That's a structure that is sent to all programs that wish to be informed
  42.   about those things, and it includes all the information about your
  43.   action, ie. the number of the key that you have pressed, the new
  44.   position of your mouse pointer if the mouse has been moved, and so on.
  45.  
  46.   Now imagine you have to repeat the same input several times, eg. you
  47.   have to type certain commands or click certain gadgets in a specific
  48.   order, and there is, for some reason, no way in which you could
  49.   automate this, by writing a script, for instance.
  50.  
  51.   Here, this program could help you. You could start Recorder, do your
  52.   input once, and this program would save all the input events that have
  53.   been generated by you in a file. Then you could play back all these
  54.   inputs, and to all applications it will look like you are doing
  55.   all inputs again, but actually they are 'fed' into the operating
  56.   system by Recorder.
  57.  
  58.   
  59.  
  60.   4. USAGE
  61.   ========
  62.  
  63.   Recorder has no GUI, so you have to start it from a command shell.
  64.   The general parameter pattern of the program is the following, where
  65.   parameters in [] are optional and (..|..|..) means you can (and must) 
  66.   choose one of the options in parentheses:
  67.  
  68.  
  69.     Recorder (Rec|Play|App) [Quick] [NoWait] [Terse] [Pri n] FILENAME
  70.  
  71.   All options excep 'Pri n' can be abbreviated by their first letter.
  72.  
  73.  
  74.   The basic operating mode is determined by one of the following:
  75.  
  76.     Rec         Record incoming input events and store them in the file with
  77.          the name FILENAME.
  78.  
  79.     Play     Play input events stored in the file FILENAME.
  80.  
  81.     App      First play input events stored in the file FILENAME, then
  82.          record more and append them to this file.
  83.          Note that if you terminate play back early in this mode, you
  84.          can't add more events, ie. Recorder just quits in that case.
  85.   
  86.  
  87.    Note:   The event file format has changed since version 1.2 (See
  88.    -----   section 9 for the reason.). If you try to play an old file,
  89.        Recorder will tell you it's not a valid event file.
  90.       
  91.  
  92.  
  93.   The meaning of the options is as follows:
  94.  
  95.     Quick    If you choose play or append, the input events are normally
  96.              played at the same speed as they were recorded. However, if
  97.          you specify this option, events are played back as fast as
  98.              possible, with no delay between them. See below for a warning
  99.          about this option.
  100.          This option is ignored in Rec mode.
  101.   
  102.     NoWait   If you specify this option, recording or play back will start
  103.          immediately, so you don't have to press the control sequence
  104.          given below first.
  105.          In append mode, recording after play back will also start
  106.          immediately.
  107.  
  108.     Terse    Recording some mouse movements, you will notice that the
  109.          mouse pointer usually hoovers around doing nothing most of
  110.          the time. With this option, Recorder will join together
  111.          these unnecessary events, making the pointer movement not
  112.          only much straighter, but also reducing the size of the
  113.          event file considerably (because LOTS of mouse move events
  114.          are usually generated). See section 6 for more info.
  115.          This option is ignored in Play mode.
  116.      
  117.     Pri n    You can specify the priority of the input handler here. The
  118.          default is 80. 
  119.  
  120.          BEWARE: This is a dangerous option. Especially too low a
  121.              priority might effectively cut off Recorder. The
  122.              program will start normally, but it might be
  123.              impossible to stop it again since the control sequence
  124.              doesn't get to the handler anymore.
  125.              USE THIS OPTION WITH CARE OR LEAVE IT ALONE.
  126.  
  127.  
  128.   Unless you specify the 'NoWait' option, recording or playing will not
  129.   begin immediately after the program has been started, but after you've
  130.   pressed the key sequence Control-Left Amiga-'s'.
  131.   You stop recording and, if you don't want to play everything back,
  132.   also play back with the same sequence.
  133.  
  134.   If you want Recorder to play the next event right away, you can press
  135.   the 'Return' key. The effect is similar to the 'Quick' option, but 
  136.   only affects one event. This function is especially usefull if you've
  137.   recorded something with the 'Terse' option (see section 6).
  138.   Note well that you only jump to the next event. Sometimes you might
  139.   not see much effect. For example, you can hardly speed up mouse
  140.   movements this way.
  141.  
  142.   It might happen that you start Recorder, and then, after a while, you
  143.   aren't sure anymore if you actually started recording already or not.
  144.   In that case you can press the key sequence Control-Left Amiga-'d'.
  145.   If the program is currently recording (or playing back, but then it
  146.   should be obvious), it will give out a display beep, but it won't do
  147.   so if it is still waiting for the start sequence.
  148.   Also, if you've started Recorder and try to start it again, it will
  149.   refuse to do so and tell you that it's already running. This avoids
  150.   that things are getting messed up if two input handlers interfere with
  151.   each other (see section 7 for a bit more detail about this).
  152.  
  153.   You will notice that mouse and keyboard are locked in playback mode,
  154.   ie. you can't make any inputs yourself. That's some sort of 'precaution',
  155.   so that you don't accidentally interfere with play back. Of course, it's
  156.   easy not to hit a key without intention, but it's not that easy with the
  157.   mouse, and, as mentioned below in section 5, often mousemove events give
  158.   only relative position, so if you would move the mouse yourself, the
  159.   mouse position might in the following not be the same as it was during
  160.   recording, and, for example, a gadget might be missed. 
  161.  
  162.   A further note about the 'Quick' option: Because often a recorded
  163.   event will result in some other action, for example, if you type a name
  164.   of a program that you want to start, the 'Return' event that's generated
  165.   when you confirm your input with the return key will result in this
  166.   program to start, which will take some time. If you make some more input
  167.   after the program has started, like clicking some gadget in that program,
  168.   and if you play back the whole thing later with the 'Quick' option, you
  169.   might get surprised. Depending on the speed of your computer, Recorder
  170.   might already feed in the clicking of the gadget before the program has
  171.   actually finished starting up. Of course, this is undesirable.
  172.   So be careful with this option !
  173.  
  174.   Since Recorder always works in the background, there are not many ways
  175.   to communicate with the user without disturbing other programs.
  176.   Therefore, whenever Recorder wants to inform you about something, it
  177.   sends a 'Display Beep' to all screens, which will make them blink, and,
  178.   depending on your system preferences, you will also hear a beep. 
  179.   It does so under the following circumstances:
  180.  
  181.     1) Whenever you press the start/stop sequence to start or stop
  182.        action to acknowlege your command.
  183.  
  184.     2) When you press Control-Left Amiga-'d' and Recorder is currently
  185.        recording or playing.
  186.  
  187.     3) When play back has finished. In append mode that means that
  188.        the program is now either waiting for the control sequence
  189.        to start recording again, or that recording has just started
  190.        again, depending on the 'NoWait' option.
  191.  
  192.     4) When the second internal buffer is full and the first one
  193.        isn't written to the file yet. Then the program terminates,
  194.        and the events in the internal buffers are saved.
  195.        However, this should usually never happen, even if you are
  196.        writing to a floppy disk (see section 8).
  197.  
  198.  
  199.  
  200.   5. WHAT DOES RECORDER RECORD ?
  201.   ==============================
  202.  
  203.   Not all possible input events are recorded - it wouldn't make any
  204.   sense to record and play back a 'disk inserted' event, when there
  205.   actually hasn't been a disk inserted ! 
  206.   In fact, all that is recorded are keyboard, mousemove and mousebutton
  207.   events, so when you click a 'Load File' gadget in a program, you
  208.   still have to insert the disk yourself ! So far, Recorder can't
  209.   simulate that.  
  210.   Actually, sometimes Recorder does record an event which hasn't really
  211.   happend. It is generated by Recorder whenever you start recording.
  212.   You might have noticed that the mouse pointer usually 'jumps' when
  213.   you start play back. This is so because a lot of events generated
  214.   by moving the mouse only give relative positions, ie. the distance
  215.   from the last mouse position. Therefore it is necessary that the mouse
  216.   pointer is, at the beginning of playback, at the same position as it
  217.   was at the beginning of recording. This is also the main reason why
  218.   you can't make any inputs while Recorder is playing.
  219.   In 'Terse' mode, a mousemove event is sometimes changed from relative
  220.   to absolute type (see next section).
  221.   
  222.  
  223.  
  224.   6. MORE ABOUT THE 'TERSE' OPTION
  225.   ================================
  226.  
  227.   The philosophy behind this option is that moving the mouse pointer
  228.   usually doesn't mean anything if no other key or button is pressed at
  229.   the same time (If some button is pressed, this might well mean something.
  230.   Just draw something in a paint program.) That is, mouse movements are
  231.   often very sloppy, you don't move the mouse in a straight line to its
  232.   destination (Which is good because it shows that you are not a machine.),
  233.   but you 'search', and maybe hesitate. If you play back something that
  234.   has been recorded  without the 'Terse' option, you will see what I mean.
  235.  
  236.   Specifying this option makes Recorder effectively omit these 'search'
  237.   movements. The program determines the total distance the mouse has moved
  238.   between two events that did incorporate some keys or buttons, and then
  239.   generates only one absolute mouse event that gives the new absolute
  240.   postion. This means that in this case the type of an event is changed,
  241.   from relative to absolute mouse postion. It's not possible to simply add
  242.   up all relative events and generate one of the same type with the sum
  243.   of them all, because a lot of people, including me, use a 'mouse
  244.   accelerator', which means that it is not the same moving the mouse
  245.   two times 10 pixels or moving it once twenty pixels. 
  246.   However, this changing of type shouln't make any problems, at least I
  247.   haven't encountered any so far.
  248.  
  249.   Using this option alone won't speed up play back, because although the
  250.   pointer movements are a lot quicker and more straight forward now,
  251.   the program is still waiting the original time between key and button
  252.   events (Unless you specify 'Quick'.), because speeding up the mouse
  253.   does unfortunately not speed up your computer. So it will happen quite
  254.   often that after the mouse pointer has moved quickly to some gadget,
  255.   nothing will happen for a while. In that case you might find the 'Return'
  256.   key quite usefull, as described above in section 4.
  257.  
  258.  
  259.  
  260.   7. COMPATIBILITY & PROBLEMS
  261.   ===========================
  262.  
  263.   The program should work on all Amiga's with at least OS2.0.
  264.  
  265.   Possibly, there might be some interference with other input event
  266.   modifying programs, such as those multi-functional commodities.
  267.   I experienced one problem with AutoCLI V2.19 (If you hit the right
  268.   mouse button after play back, the mouse pointer freezes. It 'melts'
  269.   again if you hit the button again. If you press some other key in
  270.   between, this problem vanishes.), about which I couldn't do anything
  271.   so far.
  272.  
  273.   Also, I've been reported that activation of the file-gadget with the
  274.   return key in Directory Opus does not work. I can't fix this. 
  275.   It might me that DOpus isn't using the standard input event procedure,
  276.   in which case Recorder naturally fails. 
  277.  
  278.   Currently the maximum time between two events is 10 years. This
  279.   shouldn't be too much of a limitation, I think.
  280.  
  281.  
  282.  
  283.   8. HOW DOES IT WORK
  284.   ===================
  285.  
  286.   This program installs, by means of the input device, an input handler
  287.   at high priority (80, if you don't change it with the 'Pri' option),
  288.   so that all input events pass through this handler (If there is no
  289.   input handler at higher priority which might filter some events).
  290.   These events are passed through unmodified, but also stored first
  291.   in a memory buffer and eventually in a file. The program actually
  292.   uses two buffers, and if one fills up the other one is used while the
  293.   first one is stored on disk, so that continuous recording is possible.
  294.   Should it happen that the second buffer fills up before the first one
  295.   has been written to the file, recording is terminated, and all the
  296.   so far recorded events are saved.
  297.   However, each buffer can hold about 1000 events, and an overflow
  298.   shouldn't occur, even if one writes to disk and moves the mouse
  299.   rapidly.
  300.   In play back mode, the stored events are fed into the input stream
  301.   by the same handler.
  302.   This handler also deals with the various control sequences, and tells
  303.   the main program about them.
  304.  
  305.  
  306.  
  307.   9. PROGRAM HISTORY
  308.   ==================
  309.  
  310.   First of all, thanks to the people who told me about bugs and suggested
  311.   new features, especially to Ashley Powell and Simon Dainty (Who also
  312.   did the beta testing for version 1.3) !
  313.  
  314.  
  315.   Version 1.0 (March 1991)
  316.  
  317.     - First program version; I can't remember if I published this one ?!
  318.                   
  319.   Version 1.1 (March 1996)
  320.  
  321.     - Implemented two event buffers
  322.     - The position of the mouse pointer at the beginning of recording
  323.       is now stored and set in play back.
  324.     - General revision of the program (after all those years ...).
  325.  
  326.   Version 1.2 (March 1996) - Released.
  327.  
  328.     - Implemented automatic detaching from shell.
  329.  
  330.   Version 1.3 (April 1996)
  331.  
  332.     - Keyboard and mouse are now locked in playback, so you can't screw
  333.       things up by accidently mouse the mouse.
  334.     - Recorder sometimes or always crashed when stopped in playback mode.
  335.       Fixed that.
  336.     - Recorder is now checking if it has already been started.
  337.     - The start/stop sequence is now filtered out to prevent interference
  338.       with other programs that do not ignore this sequence.
  339.     - Changed the whole command line parsing (now uses the function
  340.       ReadArgs() of dos library). This results in a new (better, I'd say ..)
  341.       command line format.
  342.     - Added the opportunity to change the priority of the input handler
  343.       with the 'Pri' option. However, this might be dangerous (see above).
  344.     - Changed the way the timing is done. This results in slightly shorter
  345.       event files (One event now uses 22 instead of 26 Bytes.), which also
  346.       makes older event files incompatible. Also, the 'Quick' option will
  347.       play quicker now.
  348.     - Added 'NoWait' option, so that recording/playing might start
  349.       immediately.
  350.     - Added the possibility to check if recording has already been
  351.       initiated by pressing Ctrl-Left Amiga-'d'.
  352.     - Added 'Terse' recording mode.
  353.     - If RETURN is pressed in play back mode, Recorder will now play the
  354.       next event immediately, ie. it will skip the current delay.
  355.     - Recorder always missed one event when the internal buffers where
  356.       changed. Fixed that.
  357.  
  358.  
  359.  
  360.              ----------------------
  361.  
  362.  
  363.  
  364.  
  365.   If you have any suggestions or find any bugs or, of course, would like
  366.   to send me any postcards (!) or gifts (!!), here's my address:
  367.  
  368.  
  369.         Oliver Grimm
  370.         Steinbecker Str.69
  371.         21244 Buchholz
  372.            Germany
  373.  
  374.             E-Mail:  grimm@physnet.uni-hamburg.de
  375.